#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main()
{
    //umask(0);
    int fd = open("log.txt",O_WRONLY | O_CREAT,0666);
    
    const char* string = "I am a process\n";
    write(fd,string,strlen(string));
    close(fd);

    return 0;
}

//int main()
//{
//    FILE* pf = fopen("log.txt","a");
//    if(pf == NULL)
//    {
//        perror("fopen");
//        return -1;
//    }
//    fprintf(pf,"%s:%lf\n","hello",9.6);
//    fclose(pf);
//    return 0;
//}
